<?php

/**
 * Matches form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class MatchesForm extends BaseMatchesForm
{
  public function configure()
  {
      unset($this['point1'],$this['point2']);
  		
		  # WIDGETS
		  $this->widgetSchema['league_id']     = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('League'), 'add_empty' => false));
		  $this->widgetSchema['team1']         = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Team'), 'add_empty' => false));
  	  $this->widgetSchema['team2']         = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Team'), 'add_empty' => false));
      $this->widgetSchema['place_id']      = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Place'), 'add_empty' => false));
      $this->widgetSchema['date']          = new sfWidgetFormDateTime(array('format'=>'%date% %time%'), array('style'=>'width:60px;'));
      
      $choices = GlobalLib::getArray('state');
      $this->widgetSchema['state']         = new sfWidgetFormChoice(array('choices'=>$choices), array('class'=>'w100px'));
      $this->widgetSchema['point1'] 	     = new sfWidgetFormInputText(array(), array('class'=>'w100px'));
      $this->widgetSchema['point2']    		 = new sfWidgetFormInputText(array(), array('class'=>'w100px'));
      $this->widgetSchema['video']         = new sfWidgetFormInputText(array(), array());
      $this->widgetSchema['summary']       = new sfWidgetFormTextarea(array(), array());
      
    	# DEFAULTS
      
      
    	# VALIDATORS
    	$this->validatorSchema['league_id']  = new sfValidatorPass();
    	$this->validatorSchema['team1']      = new sfValidatorPass();
    	$this->validatorSchema['team2']      = new sfValidatorPass();
    	$this->validatorSchema['date']       = new sfValidatorDateTime();
    	$this->validatorSchema['place_id']	 = new sfValidatorPass();
    	$this->validatorSchema['state']		   = new sfValidatorPass();
    	$this->validatorSchema['point1']  	 = new sfValidatorInteger(array('required'=>false), array());
    	$this->validatorSchema['point2']  	 = new sfValidatorInteger(array('required'=>false), array());
    	$this->validatorSchema['video']      = new sfValidatorPass();
    	$this->validatorSchema['summary']    = new sfValidatorPass();
    	
    	#HELP
    	$this->widgetSchema->setHelp('video', 'youtube video');
  }

}

